import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-08
 * Time: 16:23
 */
//递归
public class Test {
    //循环求斐波那契数列的第n项
    public static int fib2(int n){
        int f1 = 1;
        int f2 = 1;
        int f3 = 0;
        if( n == 1 || n == 2){
            return 1;
        }
        for (int i = 3; i <= n ; i++) {
            f3 = f1 + f2;
            f1 = f2;
            f2 = f3;
        }
        return f3;
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int ret = fib2(n);
        System.out.println(ret);
    }
    //递归求斐波那契数列的第n项
    public static int fib( int n){
        if( n == 1 || n == 2){
            return 1;
        }
        return fib( n - 1) + fib( n - 2);
    }
    public static void main4(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int ret = fib(n);
        System.out.println(ret);
    }
    //输入一个数 求每一位上的数字相加
    public static int sumFunc(int n ){
        if( n < 10){
            return n;
        }
        return n % 10 + sumFunc(n / 10);
    }
    public static void main3(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int ret = sumFunc(n);
        System.out.println(ret);
    }
    //输入1234 返回1 2 3 4
    public static void print(int n){
        if(n < 10){
            System.out.print(n + " ");
            return;
        }
        print(n / 10);
        System.out.print(n % 10 + " ");
    }
    public static void main2(String[] args) {
        print(1234);
    }
    //求n的阶乘
    public static int fac( int n){
        if(n == 1){
            return 1;
        }
        return n * fac(n - 1);
    }
    public static void main1(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int ret = fac(n);
        System.out.println(ret);
    }
}
